<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
 <input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<div class="t_bar"><span class="color_red">*</span>实验动物环境设施质量保障</div>

<table  id="tblMileStones5" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
   <thead >
					<tr style="border:1px solid #B7D1E6">
					  <th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="15%">设施等级</th>
						<th class="TblHead" align="center"  width="25%">检测项目</th>
						<th class="TblHead" align="center"  width="15%">检测日期</th> 
						<th class="TblHead" align="center"  width="40%">检测方式</th> 
					</tr>
		</thead>
		
		
		
    <tbody id="tab">
		      <tr style="display:none">

            <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones5" >
						</td>

						<td align="center">
							<span name="milestones5|milestone[0]@seq_no" >[index]</span> 
						</td>
						
						<td align="center">
						  <input type="text"  id="content1[0]" name="milestones5|milestone[0]|content1" label="设施等级"  maxlength="10"
						         class="required input_text"  value=""  style="width:80%"/>
						</td>
						
						<td align="center">
						       <cpt:select id="test_item_1[index]" name="test_item"  key="test_item1" onChange="initControlValue(this.id);isShow2(this)"  style="width:40%" ></cpt:select>
				           <input type="hidden" name="milestones5|milestone[0]|test_item_value" value="" class="required"  lable="检测项目"/>
				           <input type="hidden" name="milestones5|milestone[0]|test_item_name" value="" />
			      
			          <span style="display:none">其他项目:<input type="text"  id="content2[0]" name="milestones5|milestone[0]|content2" label="其他项目"  maxlength="10"
						                 class="input_text required"  value=""  style="width:30%"/>
						    </span>
			      
			      
			      </td>
		
		        <td align="center">
							<input  id="milestone_date_[0]" name="milestones5|milestone[0]|date" value="" class=" required input_text date" style="width:70px" label="检测日期" />
						</td>
		
		        <td align="center">
						       <cpt:select id="test_method_2_[index]" name="test_method"  key="test_method" onChange="initControlValue(this.id);isShow3(this)"  style="width:40%" ></cpt:select>
				           <input type="hidden" name="milestones5|milestone[0]|test_method_value" value="" class="required"  lable="检测方式"/>
				           <input type="hidden" name="milestones5|milestone[0]|test_method_name" value="" />
			      
			          <span style="display:none">委托检测单位:<input type="text"  id="content3[0]" name="milestones5|milestone[0]|content3" label="委托检测单位"  maxlength="20"
						                 class="input_text required"  value=""  style="width:30%"/>
						    </span>
			      
			      
			      </td>
		</tr>
		

	   	    <c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/milestones5/milestone" var="milestone">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr>
					
					  <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones5" >
						</td>
					
					
						<td align="center">
							<span   name="milestones5/milestone[${flag}${index}]@seq_no"><x:out select="$milestone/@seq_no"/></span> 
						</td>
						
						<td align="center">
						    <input type="text"  id="content1[${flag}${index}]" label="设施等级"  maxlength="10"  name="milestones5/milestone[${flag}${index}]/content1"
						           value="<x:out select="$milestone/content1"/>"   style="width:80%"   class="required input_text"/>
						</td>
						   
						   
						<td align="center">
			        <c:set var="test_item"><x:out select="$milestone/test_item_value" /></c:set>
			        <cpt:select id="test_item_1${index}"   name="test_item"   key="test_item1" style="width: 40%;" value="${test_item}" onChange="initControlValue(this.id);isShow2(this)"></cpt:select>
		        	<input type="hidden" name="milestones5/milestone[${flag}${index}]/test_item_value"  class="required" value="<x:out select="$milestone/test_item_value" />" label="检测项目"/>
			        <input type="hidden" name="milestones5/milestone[${flag}${index}]/test_item_name" value="<x:out select="$milestone/test_item_name" />"  label="检测项目"/>
		       
		           <span style="display:none">检测项目:<input type="text"  id="content2[${flag}${index}]" name="milestones5/milestone[${flag}${index}]/content2" label="其他项目"  maxlength="10"
						                 class="input_text required"  value="<x:out select="$milestone/content2"/>"  style="width:30%"/>
						   </span>

		        </td>
						   
						
						<td align="center">
							<c:set var="date" scope="page"><x:out select="$milestone/date"/></c:set>
							<input  id="milestone_date_[${flag}${index}]" value="${date}" label="检测日期" name="milestones5/milestone[${flag}${index}]/date" class="required date input_text"  style="width:70px"/> 
						</td>
					
						<td align="center">
			        <c:set var="test_method"><x:out select="$milestone/test_method_value" /></c:set>
			        <cpt:select id="test_method_2_${index}"   name="test_method"   key="test_method" style="width: 40%;" value="${test_method}" onChange="initControlValue(this.id);isShow3(this)"></cpt:select>
		        	<input type="hidden" name="milestones5/milestone[${flag}${index}]/test_method_value"  class="required" value="<x:out select="$milestone/test_method_value" />" label="检测方式"/>
			        <input type="hidden" name="milestones5/milestone[${flag}${index}]/test_method_name" value="<x:out select="$milestone/test_method_name" />"  label="检测方式"/>
		        
		        
						    <span style="display:none">委托检测单位:<input type="text"  id="content3[${flag}${index}]" label="委托检测单位"  maxlength="20"  name="milestones5/milestone[${flag}${index}]/content3"
						           value="<x:out select="$milestone/content3"/>"   style="width:30%"   class="required input_text"/>
						    </span>

		        </td>
		        
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblMileStones5");
					</script>
				</tbody>
</table>
<br/>

<table width="98%" align="center">
					<tr ><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones5',10,'实验动物环境设施质量保障最多只能填写10条')){addNewRow('tblMileStones5');showDateTag('tblMileStones5');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblMileStones5','selMileStones5')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblMileStones5','selMileStones5')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblMileStones5','实验动物环境设施质量保障')">
					</td></tr>
	</table>

<p>注：1、根据GB14925检测“日常性检测指标”，在设施调换/过滤器更换需检测必要检测指标。各单位可根据自己的情况增加实验动物设施环境质量控制要求。每年至少检测一次。<br/>
<span style="visibility: hidden">注：</span>2、检测方式为自检或委托检测，委托检测需填写委托检测单位。</p>
<br/>


<script type="text/javascript">
    function isShow2(obj){
    var text1 = $(obj).parents().find("td:eq(3)").find("[name$='_value']").val();
    //alert($(obj).parents().find("td").html());
    if (text1 == '04'){
    	$(obj).parents().find("td:eq(3)").find("span").css("display","");
    	$(obj).parents().find("td:eq(3)").find("span").find("[id^='content']").addClass("required");
          }	
    else{
    	$(obj).parents().find("td:eq(3)").find("span").hide();
    	$(obj).parents().find("td:eq(3)").find("span").find("[id^='content']").val("");
    	$(obj).parents().find("td:eq(3)").find("span").find("[id^='content']").removeClass("required");
          }	
    
    
    }
    
    function isShow3(obj){
        var text1 = $(obj).parents().find("td:eq(5)").find("[name$='_value']").val();
        //alert($(obj).parents().find("td").html());
        if (text1 == '02'){
        	$(obj).parents().find("td:eq(5)").find("span").css("display","");
        	$(obj).parents().find("td:eq(5)").find("span").find("[id^='content']").addClass("required");
              }	
        if (text1 == '01'){
        	$(obj).parents().find("td:eq(5)").find("span").hide();
        	$(obj).parents().find("td:eq(5)").find("span").find("[id^='content']").val("");
        	$(obj).parents().find("td:eq(5)").find("span").find("[id^='content']").removeClass("required");
              }	
        
        
        }
    
    
    
/*   $(document).ready(function(){
    	$("input[name$='/content2']").each(function(){
    		isShow(this);
    	)};
    });  */
    
  
  $(document).ready(function(){
	  $("#tblMileStones5").find("input[name$='/content2']").each(function(){
		  isShow2(this);
	  });
	  $("#tblMileStones5").find("input[name$='/content3']").each(function(){
		  isShow3(this);
	  });
  });
  
  
  
  
  
  
  
</script>